﻿using ModelLayer;
using System.Collections.Generic;
using System.Data.SqlClient;

namespace DataAccessObjectLayer
{
    internal interface IDBRoute
    {
        /// <summary>
        /// Returns a list containing all routes in the database (MiscWhere is empty, returning
        /// all)
        /// </summary>
        /// <returns>List{Route}.</returns>
        List<Route> GetAllRoutes();

        /// <summary>
        /// Returns a route from a given id
        /// </summary>
        /// <param name="routeId">The route identifier.</param>
        /// <returns>Route.</returns>
        Route GetRoute(long routeId);

        /// <summary>
        /// inserts a new route in the database with information coming from a route object
        /// SqlParameters are used to secure database from sql injections
        /// </summary>
        /// <param name="route">The route.</param>
        /// <param name="con">the current connection</param>
        /// <param name="transaction">the current transaction</param>
        /// <returns>The number of affected rows.</returns>
        /// <exception cref="System.Exception">The route was not inserted</exception>
        int InsertRoute(Route route, SqlConnection con, SqlTransaction transaction);

        /// <summary>
        /// Updates an existing customer in the database with information coming from a customer
        /// object SqlParameters are used to secure database from sql injections
        /// </summary>
        /// <param name="route">The route.</param>
        /// <returns>The number of affected rows.</returns>
        /// <exception cref="System.Exception">The route was not updated</exception>

        int UpdateRoute(Route route);

        /// <summary>
        /// Deletes a customer from the database SqlParameters are used to secure database from sql
        /// injections
        /// </summary>
        /// <param name="routeId">The route identifier.</param>
        /// <returns>System.Int32.</returns>
        /// <exception cref="System.Exception">The route was not deleted</exception>

        int RemoveRoute(long routeId);
    }
}